You need to call it when UIApplicationStateActive.
In my case, the problem was that I was calling ATTrackingManager.requestTrackingAuthorization from AppDelegates didFinishLaunchingWithOptions function.
Just calling the function from applicationDidBecomeActive fix the problem.